<template>
  <div id="history">
     <Header
           title="受理订单"
    />
   <div class="container" >
          <van-list
                        v-model="loading"
                        :finished="finished"
                       
                        finished-text="没有更多了"
                        @load="onLoad"
                        :offset="10"
                        >
                     <van-cell  v-for="(item,index) in list" :key="index" >
                             <List route="DetailsHandle" :item="item" />
                  </van-cell>
         </van-list>
         <!-- <van-tabs color="#3A73F6" @click="tabAction" title-active-color="#3A73F6" v-model="active">
            <van-tab title="待受理">
                  <van-list
                        v-model="loading"
                        :finished="finished"
                       
                        finished-text="没有更多了"
                        @load="onLoad"
                        :offset="10"
                        >
                         <van-cell  v-for="(item,index) in list" :key="index" >
                             <List :item="item" />
                        </van-cell>
                </van-list>
                
            </van-tab>
            
             <van-tab title="受理通过">
                  <van-list
                        v-model="loading"
                        :finished="finished"
                       
                        finished-text="没有更多了"
                        @load="onLoad"
                        :offset="10"
                        >
                         <van-cell  v-for="(item,index) in list" :key="index" >
                             <List :item="item" />
                        </van-cell>
                </van-list>
            
            </van-tab>
             <van-tab title="受理驳回">
                <van-list
                        v-model="loading"
                        :finished="finished"
                       
                        finished-text="没有更多了"
                        @load="onLoad"
                        :offset="10"
                        >
                         <van-cell  v-for="(item,index) in list" :key="index" >
                             <List :item="item" />
                         </van-cell>
                </van-list>
            </van-tab>
          </van-tabs>
          -->
    </div>
  </div>
</template>

<script>
import List from '../../components/List'
import  Header from '../../components/Header'

export default {
  name: 'Handle',
  data() {
    return {
        active:0,
        data:{},
        list:[],
        page:1,
        loading:false,
        isLoading:false,
        finished:false,
        url:"/carorder/queryListAudit",
        urls:[
            "/carorder/queryListAudit",
            "/carorder/queauditPass",
            "/carorder/queauditPass"
           
        ],
       
    }
  },
   created(){
     this.getListData()
  },
 
  methods: {
     tabAction(){
       console.log(this.active)
       this.url=this.urls[0]
       this.list=[]
  
     } ,
     onLoad(){
        if(!this.isLoading){
          
          this.getListData()
        }
           
      
       
    },
    getListData(){
      this.$http.get(this.url,{
             userId:localStorage.getItem("userId"),
             pageNo:this.page,
             pageSize:10
         })
         .then(result=>{
            this.loading=false
             this.isLoading=false
              if(result.data.beans.length<10){
                 this.finished=true
                 return
              }
              this.page=this.page+1
              this.data=result.data
              this.list= this.list.concat(result.data.beans);
              console.log( this.list)
            
            
         }).catch((e)=>{
              console.log(e)
         })
    }
  },
  components: {
    "List":List,
     "Header":Header

  }
}
</script>

<style scoped>



</style>
